<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>转运单管理</title>
    <link rel="stylesheet" href="http://static-online.zhaogangtest.com/publicresource/css/bootstrap-table.css">
    <link rel="stylesheet" href="../../../resources/public/css/table.css">
    <link rel="stylesheet" href="../../../resources/public/css/bootstrap-table-fixed-columns.css">
     <link rel="stylesheet" href="http://static-online.zhaogangtest.com/publicresource/control/daterangpicker/daterangepicker-bs3.css"> 
    <link rel="stylesheet" href="../../../resources/public/css/iconfont.min.css">
    <link rel="stylesheet" href="../../../resources/public/css/scmstrap.css">
</head>

<body>
    <div class="main">
        <!-- 条件区域 -->
        <div class="form-list">
            <div class="group">
                <label>
                    <b class="must">*</b>转运单号</label>
                <div class="scm-input-wrap">
                    <input type="text" class="scm-input scm-input-read" readonly="" value="ZYDD20180711001">
                </div>
            </div>
            <div class="group">
                <label>
                    <b class="must">*</b>制单日期</label>
                <div class="scm-input-wrap">
                    <input type="text" class="scm-input scm-input-read" readonly="" value="2018-07-11 16:15:22">
                </div>
            </div>
            <div class="group">
                <label>
                    <b class="must">*</b>发货仓库</label>
                <div class="scm-input-wrap">
                    <input type="text" class="scm-input scm-input-read" readonly="" value="长达中板厂库">
                </div>
            </div>
            <div class="group">
                <label>
                    <b class="must">*</b>收货仓库</label>
                <div class="scm-input-wrap">
                    <input type="text" class="scm-input scm-input-read" readonly="" value="常州仓库">
                </div>
            </div>
            <div class="group">
                <label>
                    <b class="must">*</b>发货方式</label>
                <div class="scm-input-wrap">
                    <input type="text" class="scm-input scm-input-read" readonly="" value="按件">
                </div>
            </div>
            <div class="group">
                <label>
                    <b class="must">*</b>配货性质</label>
                <div class="scm-input-wrap">
                    <input type="text" class="scm-input scm-input-read" readonly="" value="现货">
                </div>
            </div>
            <div class="group">
                <label>
                    <b class="must">*</b>业务机构</label>
                <div class="scm-input-wrap">
                    <input type="text" class="scm-input scm-input-read" readonly="" value="长达钢铁">
                </div>
            </div>
            <div class="group">
                <label>
                    <b class="must">*</b>业务部门</label>
                <div class="scm-input-wrap">
                    <input type="text" class="scm-input scm-input-read" readonly="" value="销售部">
                </div>
            </div>
            <div class="group">
                <label>
                    <b class="must">*</b>车船号</label>
                <div class="scm-input-wrap condition-msg-style">
                    <input class="scm-input" placeholder="11" type="text">
                </div>
                <span class="condition-msg red">请用/隔开</span>
            </div>
            <div class="group">
                <label><b class="must">*</b>车船号</label>
                <div class="scm-input-wrap">
                    <input type="text" class="scm-input" placeholder="鄂A92324">
                </div>
            </div>
             <div class="group">
                <label>
                    <b class="must">*</b>提货方式</label>
                <div class="scm-input-wrap">
                    <input type="text" class="scm-input scm-input-read" readonly="" value="船运配送">
                </div>
            </div>
             <div class="group">
                <label>备注</label>
                <div class="scm-input-wrap">
                    <input type="text" class="scm-input">
                </div>
            </div>
        </div>
        <!-- 按钮 -->
        <div class="operation">
            <div class="conditionbtn">
                <button class="scm-btn blue">
                    <i class="anticon icon-search1"></i>搜索</button>
                <button class="scm-btn">
                    <i class="anticon icon-delete"></i>重置</button>
            </div>
            <div class="scm-btn-group fr">
                <button class="scm-btn btn-disable-style">
                    <i class="anticon icon-isv"></i>现货物资
                </button>
                <button class="scm-btn btn-disable-style">
                    <i class="anticon icon-isv"></i>计划物资
                </button>
                <button class="scm-btn btn-disable-style">
                    <i class="anticon icon-delete"></i>删除
                </button>
            </div>
        </div>
        <div class="box-table">
            <table class="table table-condensed" id="table-parent"></table>
        </div>
    </div>
    <script src="http://static-online.zhaogangtest.com/publicresource/js/require.js"></script>
    <script>
        var page;

        require.config({
            paths: {
                "jquery": "../../../resources/public/js/jquery.min",
                "bootstrap": 'http://static-online.zhaogangtest.com/publicresource/js/bootstrap.min',
                // "bootstrap-table": "http://static-online.zhaogangtest.com/publicresource/js/bootstrap-table",
                "bootstrap-table": "../../../resources/public/js/bootstrap-table",
                "moment": "http://static-online.zhaogangtest.com/publicresource/control/daterangpicker/moment.min",
                "daterangepicker": "../../../resources/public/js/daterangepicker",
                "layer": 'http://static-online.zhaogangtest.com/publicresource/control/layer/layer.min',
                "public": "../../../resources/public/js/public",
                "chinese": "../../../resources/public/js/chinese",
                "bootstrap-table-fixed": "../../../resources/public/js/bootstrap-table-fixed-columns",
                "autocomplete": "../../../resources/public/js/jquery.autocomplete",
            },
            shim: {
                "jquery": {
                    exports: ['jQuery', '$']
                },
                "bootstrap": {
                    deps: ["jquery"]
                },
                "bootstrap-table": {
                    deps: ["jquery", "bootstrap"]
                },
                "bootstrap-table-fixed": {
                    deps: ["bootstrap-table"]
                },
                "layer": {
                    deps: ["jquery"],
                    exports: "layer"
                },
                "autocomplete": {
                    deps: ['jquery']
                },
                "moment": {
                    deps: ['jquery']
                },
                "daterangepicker": {
                    deps: ["jquery", "moment"],
                    exports: "daterangepicker"
                },
                "chinese": {
                    deps: ["jquery", "bootstrap-table"],
                },

                "public": {
                    deps: ["jquery", "bootstrap-table","moment","daterangepicker"]
                }
            }
        });
        require([ "autocomplete","public", "layer", "chinese", "bootstrap-table-fixed"], function () {
            layer.config({
                path: 'http://static-online.zhaogangtest.com/publicresource/control/layer/'
            });
            $(function () {
                page = {
                    init: function () {
                        this.bootstrapTable();
                        this.autocomplete();
                        this.fn_layer();

                        var that = this;
                        $(window).resize(function () {
                            $('#table-parent').bootstrapTable('resetView', {
                                height: that.getHeight()
                            });
                            $('.daterangepicker').hide()
                        });
                        $.daterangepicker("#datepicker", {
                             singleDatePicker: false, 
                         });

                    },
                    bootstrapTable: function () {
                        $('#table-parent').bootstrapTable({
                            pagination: true, //在表格底部显示分页工具栏
                            pageSize: 50,
                            pageNumber: 1,
                            pageList: [10, 25, 50, 100],
                            height: page.getHeight(),
                            showFooter: true,
                            showColumns: false,
                            showRefresh: false,
                            //                    showToggle:true,
                            search: false,
                            //                    showPaginationSwitch:true,
                            // detailView: true,
                            // detailFormatter: page.showdetail,
                            // detailFormatter: this.showChild,
                            // onExpandRow: this.expandRow,
                            // onCollapseRow: this.collapseRow,
                            locales: 'zh-CN',
                            fixedColumns: false,
                            fixedNumber: 1,
                            url: '../data/erp/tablelist-transport-manage.json',
                            sidePagination: "server", //分页方式：client客户端分页，server服务端分页（*）

                            columns: [{
                                "field": "n0",
                                "title": "序号",
                                formatter: function (value, row, index) {
                                    return index + 1
                                },
                                footerFormatter: "合计"
                            }, {
                                "field": "n1",
                                "title": "<b class='must'>*</b>&nbsp;库房",
                            }, {
                                "field": "n2",
                                "title": "品名",
                            }, {
                                "field": "n3",
                                "title": "材质",
                            }, {
                                "field": "n4",
                                "title": "标准",
                            }, {
                                "field": "n5",
                                "title": "规格",

                            }, {
                                "field": "n6",
                                "title": "指定长度",
                            }, {
                                "field": "n7",
                                "title": "品质",
                            }, {
                                "field": "n8",
                                "title": "计量方式",
                            }, {
                                "field": "n9",
                                "title": "交货状态",
                            }, {
                                "field": "n10",
                                "title": "件支数",
                                footerFormatter: public.fn_sumformatter,

                            }, {
                                "field": "n11",
                                "title": "产品类型",
                                footerFormatter: public.fn_sumformatter,
                            }, {
                                "field": "n12",
                                "title": "<b class='must'>*</b>&nbsp;应提数量",
                                
                            }, {
                                "field": "n13",
                                "title": "<b class='must'>*</b>&nbsp;应提重量",
                            }, {
                                "field": "n14",
                                "title": "备注",
                            }]
                        });
                    },
                    showdetail: function (a, b, c) {
                        $(c).append(
                            '<div class="box-body"><table class="table table-condensed innerTable" id="tabledetail' +
                            a + '"></table></div>');
                        $('#tabledetail' + a).bootstrapTable({
                            pagination: false, //在表格底部显示分页工具栏
                            showFooter: false,
                            locales: 'zh-CN',
                            url: '../data/erp/tablelist-transport-manage-child.json',
                            sidePagination: "server", //分页方式：client客户端分页，server服务端分页（*）
                            columns: [{
                                    "field": "n1",
                                    "title": "库房"
                                },
                                {
                                    "field": "n2",
                                    "title": "品名"
                                },
                                {
                                    "field": "n3",
                                    "title": "材质",
                                },
                                {
                                    "field": "n4",
                                    "title": "标准"
                                },
                                {
                                    "field": "n5",
                                    "title": "规格"
                                }, {
                                    "field": "n6",
                                    "title": "品质",
                                }, {
                                    "field": "n7",
                                    "title": "计量方式",
                                }, {
                                    "field": "n8",
                                    "title": "交货状态",
                                }, {
                                    "field": "n9",
                                    "title": "实提数量",
                                }, {
                                    "field": "n10",
                                    "title": "实提重量",
                                }, {
                                    "field": "n11",
                                    "title": "备注",
                                }
                            ],

                        });
                    },


                     fn_layer: function () {
                        $(document).on('click', '.btn-adjust-transport', function () {
                            parent.unify.fn_detail('erp/erp-transport-manage-child.html','修改转运单ZYDD20180711001', '修改转运单ZYDD2018071100')
                        })
                    },
                    autocomplete: function () {
                        var data = ['上海钢找塑料', '上海钢富信息科技有限技有限公司', '上海找油网信息科技', '上海长城实业有限公司',
                            '上海找油网信息科技', '上海长城实业有限公司'
                        ]
                        $("#company input").autocomplete({
                            lookup: data,
                            minChars: 0,
                            appendTo: '#companywrap',
                            onSelect: function (suggestion) {
                                // $(this).val(suggestion.value);
                            },
                        });
                        $("#company1 input").autocomplete({
                            lookup: data,
                            minChars: 0,
                            appendTo: '#companywrap1',
                            onSelect: function (suggestion) {
                                // $(this).val(suggestion.value);
                            },
                        });
                        $("#company2 input").autocomplete({
                            lookup: data,
                            minChars: 0,
                            appendTo: '#companywrap2',
                            onSelect: function (suggestion) {
                                // $(this).val(suggestion.value);
                            },
                        });
                        $("#company3 input").autocomplete({
                            lookup: data,
                            minChars: 0,
                            appendTo: '#companywrap3',
                            onSelect: function (suggestion) {
                                // $(this).val(suggestion.value);
                            },
                        });
                        $("#company4 input").autocomplete({
                            lookup: data,
                            minChars: 0,
                            appendTo: '#companywrap4',
                            onSelect: function (suggestion) {
                                // $(this).val(suggestion.value);
                            },
                        });
                    },
                    // 表格高度
                    getHeight: function () {
                        var _height = $('.form-list').outerHeight(
                            true) + $('.operation').outerHeight(true)
                        return $(window).height() - _height - 20;
                    },
                }
                page.init();
            })
        })
    </script>
</body>

</html>